home *** CD-ROM | disk | FTP | other *** search
/ Aminet 50 / Aminet 50 (2002)(GTI - Schatztruhe)[!][Aug 2002].iso / Aminet / text / edit / tecoc-146.lha / exeu.c < prev    next >
C/C++ Source or Header  |  1991-07-05  |  1KB  |  48 lines

  1. /*****************************************************************************
  2.  
  3.     ExeU()
  4.  
  5.     This function performs a U command.
  6.  
  7.     nUq    Put number n into Q-register q
  8. *****************************************************************************/
  9.  
  10. #include "zport.h"        /* define portability identifiers */
  11. #include "tecoc.h"        /* define general identifiers */
  12. #include "defext.h"        /* define external global variables */
  13. #include "deferr.h"        /* define identifiers for error messages */
  14.  
  15. DEFAULT ExeU()                    /* execute U command */
  16. {
  17.     DBGFEN(1,"ExeU",NULL);
  18.     if (EStTop == EStBot) {            /* if no numeric argument */
  19.         ErrMsg(ERR_NAU);
  20.         DBGFEX(1,DbgFNm,"FAILURE, no arg before U");
  21.         return FAILURE;
  22.     }
  23.  
  24.     if (GetNmA() == FAILURE) {        /* get numeric argument */
  25.         DBGFEX(1,DbgFNm,"FAILURE, GetNmA() failed");
  26.         return FAILURE;
  27.     }
  28.     if (IncCBP() == FAILURE) {        /* increment to Q-reg name */
  29.         DBGFEX(1,DbgFNm,"FAILURE, IncCBp() failed.");
  30.         return FAILURE;
  31.     }
  32.     if (FindQR() == FAILURE) {
  33.         DBGFEX(1,DbgFNm,"FAILURE, FindQR() failed");
  34.         return FAILURE;
  35.     }
  36.  
  37.     QR->Number = NArgmt;
  38.     if (CmdMod & MARGIS) {            /* if m,nUq */
  39.         DBGFEX(1,DbgFNm,"PushEx()");
  40.         return PushEx(MArgmt, OPERAND);
  41.     }
  42.  
  43.     CmdMod = '\0';                /* clear modifiers flags */
  44.  
  45.     DBGFEX(1,DbgFNm,"SUCCESS");
  46.     return SUCCESS;
  47. }
  48.